home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 400_01 / socketpp-1.5 / test / tpopen.cc < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-06  |  906 b   |  36 lines

  1. // tpopen.cc. Test for -*- C++ -*- socket library
  2. // Copyright (C) 1992,1993 Gnanasekaran Swaminathan <gs4t@virginia.edu>
  3. // 
  4. // Permission is granted to use at your own risk and distribute this software
  5. // in source and binary forms provided the above copyright
  6. // notice and this paragraph are preserved on all copies.
  7. // This software is provided "as is" with no express or implied warranty.
  8. //
  9. // Version: 07Nov93 1.5
  10.  
  11. #include <pipestream.h>
  12.  
  13. extern "C" {
  14.     int    sleep(int);
  15. }
  16.  
  17. main()
  18. {
  19.     char    buf[128];
  20.  
  21.     ipipestream ipopen("tpopentest -o");
  22.     cout << "Got from ipopen: ";
  23.     while(ipopen >> buf)
  24.         cout << buf << ' ';
  25.     cout << endl;
  26.     
  27.     opipestream opopen("tpopentest -i");
  28.     opopen << "this is sent to tpopentest" << endl;
  29.  
  30.     iopipestream iopopen("tpopentest -b");
  31.     iopopen << "echo test one two three" << endl;
  32.     cout << "Result from iopopen: ";
  33.     while (iopopen >> buf) cout << buf << ' ';
  34.     cout << endl;
  35. }
  36.